home *** CD-ROM | disk | FTP | other *** search
/ InterCD 2000 September / september_2000.iso / intercd / root / ^Linux / WindowMaker / contrib / single_click.diff < prev    next >
Encoding:
Text File  |  1999-05-01  |  10.8 KB  |  362 lines

  1. diff -rc WindowMaker-0.52.0.ori/WPrefs.app/Appearance.c WindowMaker-0.52.0/WPrefs.app/Appearance.c
  2. *** WindowMaker-0.52.0.ori/WPrefs.app/Appearance.c    Mon Mar 22 12:16:49 1999
  3. --- WindowMaker-0.52.0/WPrefs.app/Appearance.c    Wed Apr 21 08:24:11 1999
  4. ***************
  5. *** 1286,1315 ****
  6.   
  7.       setupTextureFor(panel->texLs, "FTitleBack", "(solid, black)", 
  8.               "[Focused]", i);
  9. !     panel->textureIndex[i] = i++;
  10.   
  11.       setupTextureFor(panel->texLs, "UTitleBack", "(solid, gray)", 
  12.               "[Unfocused]", i);
  13. !     panel->textureIndex[i] = i++;
  14.   
  15.       setupTextureFor(panel->texLs, "PTitleBack", "(solid, \"#616161\")",
  16.               "[Owner of Focused]", i);
  17. !     panel->textureIndex[i] = i++;
  18.   
  19.       setupTextureFor(panel->texLs, "MenuTitleBack", "(solid, black)", 
  20.               "[Menu Title]", i);
  21. !     panel->textureIndex[i] = i++;
  22.   
  23.       setupTextureFor(panel->texLs, "MenuTextBack", "(solid, gray)", 
  24.               "[Menu Item]", i);
  25. !     panel->textureIndex[i] = i++;
  26.   
  27.       setupTextureFor(panel->texLs, "IconBack", "(solid, gray)", "[Icon]", i);
  28. !     panel->textureIndex[i] = i++;
  29.   /*
  30.       setupTextureFor(panel->texLs, "WorkspaceBack", "(solid, black)", 
  31.               "[Workspace]", i);
  32. !     panel->textureIndex[i] = i++;
  33.    */
  34.   
  35.       updatePreviewBox(panel, EVERYTHING);
  36. --- 1286,1315 ----
  37.   
  38.       setupTextureFor(panel->texLs, "FTitleBack", "(solid, black)", 
  39.               "[Focused]", i);
  40. !     panel->textureIndex[i++] = i;
  41.   
  42.       setupTextureFor(panel->texLs, "UTitleBack", "(solid, gray)", 
  43.               "[Unfocused]", i);
  44. !     panel->textureIndex[i++] = i;
  45.   
  46.       setupTextureFor(panel->texLs, "PTitleBack", "(solid, \"#616161\")",
  47.               "[Owner of Focused]", i);
  48. !     panel->textureIndex[i++] = i;
  49.   
  50.       setupTextureFor(panel->texLs, "MenuTitleBack", "(solid, black)", 
  51.               "[Menu Title]", i);
  52. !     panel->textureIndex[i++] = i;
  53.   
  54.       setupTextureFor(panel->texLs, "MenuTextBack", "(solid, gray)", 
  55.               "[Menu Item]", i);
  56. !     panel->textureIndex[i++] = i;
  57.   
  58.       setupTextureFor(panel->texLs, "IconBack", "(solid, gray)", "[Icon]", i);
  59. !     panel->textureIndex[i++] = i;
  60.   /*
  61.       setupTextureFor(panel->texLs, "WorkspaceBack", "(solid, black)", 
  62.               "[Workspace]", i);
  63. !     panel->textureIndex[i++] = i;
  64.    */
  65.   
  66.       updatePreviewBox(panel, EVERYTHING);
  67. diff -rc WindowMaker-0.52.0.ori/WPrefs.app/Expert.c WindowMaker-0.52.0/WPrefs.app/Expert.c
  68. *** WindowMaker-0.52.0.ori/WPrefs.app/Expert.c    Thu Mar 18 17:39:22 1999
  69. --- WindowMaker-0.52.0/WPrefs.app/Expert.c    Thu Apr 15 09:02:54 1999
  70. ***************
  71. *** 31,37 ****
  72.       
  73.       WMWindow *win;
  74.   
  75. !     WMButton *swi[5];
  76.   
  77.   } _Panel;
  78.   
  79. --- 31,37 ----
  80.       
  81.       WMWindow *win;
  82.   
  83. !     WMButton *swi[6];
  84.   
  85.   } _Panel;
  86.   
  87. ***************
  88. *** 50,55 ****
  89. --- 50,56 ----
  90.       WMSetButtonSelected(panel->swi[2], GetBoolForKey("SaveSessionOnExit"));
  91.       WMSetButtonSelected(panel->swi[3], GetBoolForKey("UseSaveUnders"));
  92.       WMSetButtonSelected(panel->swi[4], GetBoolForKey("DisableBlinking"));
  93. +     WMSetButtonSelected(panel->swi[5], GetBoolForKey("SingleClickLaunch"));
  94.   }
  95.   
  96.   
  97. ***************
  98. *** 63,69 ****
  99.       WMResizeWidget(panel->frame, FRAME_WIDTH, FRAME_HEIGHT);
  100.       WMMoveWidget(panel->frame, FRAME_LEFT, FRAME_TOP);
  101.   
  102. !     for (i=0; i<5; i++) {
  103.       panel->swi[i] = WMCreateSwitchButton(panel->frame);
  104.       WMResizeWidget(panel->swi[i], FRAME_WIDTH-40, 25);
  105.       WMMoveWidget(panel->swi[i], 20, 20+i*25);
  106. --- 64,70 ----
  107.       WMResizeWidget(panel->frame, FRAME_WIDTH, FRAME_HEIGHT);
  108.       WMMoveWidget(panel->frame, FRAME_LEFT, FRAME_TOP);
  109.   
  110. !     for (i=0; i<6; i++) {
  111.       panel->swi[i] = WMCreateSwitchButton(panel->frame);
  112.       WMResizeWidget(panel->swi[i], FRAME_WIDTH-40, 25);
  113.       WMMoveWidget(panel->swi[i], 20, 20+i*25);
  114. ***************
  115. *** 74,79 ****
  116. --- 75,81 ----
  117.       WMSetButtonText(panel->swi[2], _("Automatically save session when exiting WindowMaker"));
  118.       WMSetButtonText(panel->swi[3], _("Use SaveUnder in window frames, icons, menus and other objects"));
  119.       WMSetButtonText(panel->swi[4], _("Disable cycling color highlighting of icons."));
  120. +     WMSetButtonText(panel->swi[5], _("Launch applications and restore windows with a single click"));
  121.   
  122.       WMRealizeWidget(panel->frame);
  123.       WMMapSubwidgets(panel->frame);
  124. ***************
  125. *** 94,99 ****
  126. --- 96,102 ----
  127.       SetBoolForKey(WMGetButtonSelected(panel->swi[2]), "SaveSessionOnExit");
  128.       SetBoolForKey(WMGetButtonSelected(panel->swi[3]), "UseSaveUnders");
  129.       SetBoolForKey(WMGetButtonSelected(panel->swi[4]), "DisableBlinking");
  130. +     SetBoolForKey(WMGetButtonSelected(panel->swi[5]), "SingleClickLaunch");
  131.   }
  132.   
  133.   
  134. diff -rc WindowMaker-0.52.0.ori/src/WindowMaker.h WindowMaker-0.52.0/src/WindowMaker.h
  135. *** WindowMaker-0.52.0.ori/src/WindowMaker.h    Mon Mar 22 12:16:50 1999
  136. --- WindowMaker-0.52.0/src/WindowMaker.h    Wed Apr 14 10:35:40 1999
  137. ***************
  138. *** 348,353 ****
  139. --- 348,356 ----
  140.       /* shading animation */
  141.       char shade_speed;
  142.   
  143. +     /* single click to lauch applications */
  144. +     char single_click;
  145.       int edge_resistance;
  146.   
  147.       struct {
  148. diff -rc WindowMaker-0.52.0.ori/src/appicon.c WindowMaker-0.52.0/src/appicon.c
  149. *** WindowMaker-0.52.0.ori/src/appicon.c    Thu Apr  1 12:33:57 1999
  150. --- WindowMaker-0.52.0/src/appicon.c    Wed Apr 14 10:38:03 1999
  151. ***************
  152. *** 710,715 ****
  153. --- 710,716 ----
  154.       int shad_x = 0, shad_y = 0, docking=0, dockable, collapsed = 0;
  155.       int ix, iy;
  156.       int clickButton = event->xbutton.button;
  157. +     Bool hasMoved;
  158.       Pixmap ghost = None;
  159.   
  160.       if (aicon->editing || WCHECK_STATE(WSTATE_MODAL))
  161. ***************
  162. *** 758,763 ****
  163. --- 759,765 ----
  164.         dockable = canBeDocked(icon->owner);
  165.   
  166.   
  167. +     hasMoved = False;
  168.       while (!done) {
  169.       WMMaskEvent(dpy, PointerMotionMask|ButtonReleaseMask|ButtonPressMask
  170.               |ButtonMotionMask|ExposureMask, &ev);
  171. ***************
  172. *** 767,772 ****
  173. --- 769,775 ----
  174.           break;
  175.   
  176.        case MotionNotify:
  177. +         hasMoved = True;
  178.           if (!grabbed) {
  179.           if (abs(dx-ev.xmotion.x)>=MOVE_THRESHOLD
  180.               || abs(dy-ev.xmotion.y)>=MOVE_THRESHOLD) {
  181. ***************
  182. *** 917,922 ****
  183. --- 920,928 ----
  184.           XSetWindowBackground(dpy, scr->dock_shadow, scr->white_pixel);
  185.           }
  186.           done = 1;
  187. +         if (!hasMoved && wPreferences.single_click) {
  188. +             iconDblClick(desc, event);
  189. +         }
  190.           break;
  191.       }
  192.       }
  193. diff -rc WindowMaker-0.52.0.ori/src/defaults.c WindowMaker-0.52.0/src/defaults.c
  194. *** WindowMaker-0.52.0.ori/src/defaults.c    Mon Mar 22 12:16:51 1999
  195. --- WindowMaker-0.52.0/src/defaults.c    Wed Apr 14 10:54:24 1999
  196. ***************
  197. *** 445,450 ****
  198. --- 445,453 ----
  199.       {"DisableBlinking",    "NO",        NULL,
  200.          &wPreferences.dont_blink,    getBool,    NULL
  201.       },
  202. +     {"SingleClickLaunch", "NO",        NULL,
  203. +        &wPreferences.single_click,    getBool,    NULL
  204. +     },
  205.   #ifdef WEENDOZE_CYCLE
  206.       {"WindozeCycling","NO", NULL,
  207.           &wPreferences.windoze_cycling,    getBool, NULL
  208. diff -rc WindowMaker-0.52.0.ori/src/dock.c WindowMaker-0.52.0/src/dock.c
  209. *** WindowMaker-0.52.0.ori/src/dock.c    Mon Mar 22 12:16:51 1999
  210. --- WindowMaker-0.52.0/src/dock.c    Wed Apr 14 10:37:30 1999
  211. ***************
  212. *** 3484,3490 ****
  213.   
  214.   
  215.   
  216. ! static void
  217.   handleIconMove(WDock *dock, WAppIcon *aicon, XEvent *event)
  218.   {
  219.       WScreen *scr = dock->screen_ptr;
  220. --- 3484,3490 ----
  221.   
  222.   
  223.   
  224. ! static int
  225.   handleIconMove(WDock *dock, WAppIcon *aicon, XEvent *event)
  226.   {
  227.       WScreen *scr = dock->screen_ptr;
  228. ***************
  229. *** 3499,3507 ****
  230.       int ix = aicon->xindex, iy = aicon->yindex;
  231.       int tmp;
  232.       Pixmap ghost = None;
  233. !     Bool docked;
  234.       int superfluous = wPreferences.superfluous; /* we catch it to avoid problems */
  235.   
  236.       if (wPreferences.flags.noupdates)
  237.       return;
  238.       
  239. --- 3499,3508 ----
  240.       int ix = aicon->xindex, iy = aicon->yindex;
  241.       int tmp;
  242.       Pixmap ghost = None;
  243. !     Bool docked, hasMoved;
  244.       int superfluous = wPreferences.superfluous; /* we catch it to avoid problems */
  245.   
  246. +     hasMoved = False;
  247.       if (wPreferences.flags.noupdates)
  248.       return;
  249.       
  250. ***************
  251. *** 3551,3556 ****
  252. --- 3552,3558 ----
  253.           break;
  254.   
  255.        case MotionNotify:
  256. +         hasMoved = True;
  257.           if (!grabbed) {
  258.           if (abs(ofs_x-ev.xmotion.x)>=MOVE_THRESHOLD
  259.               || abs(ofs_y-ev.xmotion.y)>=MOVE_THRESHOLD) {
  260. ***************
  261. *** 3690,3696 ****
  262.   #ifdef DEBUG
  263.           puts("End icon move");
  264.   #endif
  265. !         return;
  266.       }
  267.       }
  268.   }
  269. --- 3692,3701 ----
  270.   #ifdef DEBUG
  271.           puts("End icon move");
  272.   #endif
  273. !         if (!hasMoved) {
  274. !             return 1;
  275. !         }
  276. !         return 0;
  277.       }
  278.       }
  279.   }
  280. ***************
  281. *** 3807,3813 ****
  282.       XUnmapWindow(dpy, scr->clip_balloon);
  283.       scr->flags.clip_balloon_mapped = 0;
  284.       }
  285. !     
  286.   #ifdef DEBUG
  287.       puts("handling dock");
  288.   #endif
  289. --- 3812,3818 ----
  290.       XUnmapWindow(dpy, scr->clip_balloon);
  291.       scr->flags.clip_balloon_mapped = 0;
  292.       }
  293. !  
  294.   #ifdef DEBUG
  295.       puts("handling dock");
  296.   #endif
  297. ***************
  298. *** 3830,3836 ****
  299.               else
  300.                   handleDockMove(dock, aicon, event);
  301.           } else
  302. !         handleIconMove(dock, aicon, event);
  303.       
  304.       } else if (event->xbutton.button==Button2 && dock->type==WM_CLIP &&
  305.                  aicon->xindex==0 && aicon->yindex==0) {
  306. --- 3835,3843 ----
  307.               else
  308.                   handleDockMove(dock, aicon, event);
  309.           } else
  310. !         if (handleIconMove(dock, aicon, event) != 0 &&
  311. !                 wPreferences.single_click)
  312. !             iconDblClick(desc, event);
  313.       
  314.       } else if (event->xbutton.button==Button2 && dock->type==WM_CLIP &&
  315.                  aicon->xindex==0 && aicon->yindex==0) {
  316. diff -rc WindowMaker-0.52.0.ori/src/icon.c WindowMaker-0.52.0/src/icon.c
  317. *** WindowMaker-0.52.0.ori/src/icon.c    Thu Mar 18 17:39:39 1999
  318. --- WindowMaker-0.52.0/src/icon.c    Wed Apr 14 10:37:02 1999
  319. ***************
  320. *** 809,814 ****
  321. --- 809,815 ----
  322.       int dx=event->xbutton.x, dy=event->xbutton.y;
  323.       int grabbed=0;
  324.       int clickButton=event->xbutton.button;
  325. +     Bool hasMoved;
  326.   
  327.       if (WCHECK_STATE(WSTATE_MODAL))
  328.       return;
  329. ***************
  330. *** 851,856 ****
  331. --- 852,858 ----
  332.       wwarning("pointer grab failed for icon move");
  333.   #endif
  334.       }
  335. +     hasMoved = False;
  336.       while(1) {
  337.       WMMaskEvent(dpy, PointerMotionMask|ButtonReleaseMask|ButtonPressMask
  338.              |ButtonMotionMask|ExposureMask, &ev);
  339. ***************
  340. *** 860,865 ****
  341. --- 862,868 ----
  342.           break;
  343.   
  344.        case MotionNotify:
  345. +         hasMoved = True;
  346.           if (!grabbed) {
  347.           if (abs(dx-ev.xmotion.x)>=MOVE_THRESHOLD
  348.               || abs(dy-ev.xmotion.y)>=MOVE_THRESHOLD) {
  349. ***************
  350. *** 897,902 ****
  351. --- 900,908 ----
  352.   
  353.           if (wPreferences.auto_arrange_icons)
  354.           wArrangeIcons(wwin->screen_ptr, True);
  355. +         if (!hasMoved && wPreferences.single_click) {
  356. +             miniwindowDblClick(desc, event);
  357. +         }
  358.           return;
  359.           
  360.       }
  361.